<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <title>用户个人资料</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>

    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>

    <style>
        .layui-form-item .layui-input-inline {
            float: left;
            width: 194px;
            margin-right: 16px;
            margin-top: 8px;
        }

        #ckf {
            text-align: center;
            border: 1px #00F solid;
            margin: 17px 350px;
        }

        .layui-row {
            margin: 0px auto
        }
    </style>

</head>

<body>
<div class="layui-fluid">
    <div class="layui-row">

        <form class="layui-form" id="ckf">
            <div class="layui-form-item">
                <label class="layui-form-label ">
                    <span class="x-red">*</span>登录名：
                </label>
                <div class="layui-input-inline">
                    <span><shiro:principal property="empName"/></span>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>年龄
                </label>
                <div class="layui-input-inline">
                    <span><shiro:principal property="age"/></span>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label ">
                    <span class="x-red">*</span>姓别：
                </label>
                <div class="layui-input-inline">
                    <span><shiro:principal property="sex"/></span>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label ">
                    <span class="x-red">*</span>电话：
                </label>
                <div class="layui-input-inline">
                    <span><shiro:principal property="phone"/></span>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>地址
                </label>
                <div class="layui-input-inline">
                    <span><shiro:principal property="address"/></span>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label"></label>

                <a href="/index" class="layui-btn">返回</a>
            </div>

        </form>

    </div>
</div>


<script src="/static/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>

<script>

    $(function () {

        $(document).on("click", "#submit_admin", function () {

            $.ajax({
                url: "/showAdminInfo",
                type: "GET",
                data: {
                    userName: $("#name").val(),
                    age: $("#age").val(),
                    sex: $("#sex").val(),
                    phone: $("#phone").val(),
                    address: $("#address").val()

                },
                success: function (data) {
                    console.log(data);
                    console.log(data.code);


                    if (data.code == 200) {
                        layer.msg("查询成功！", {icon: 6, time: 4000});
                        console.log("查询成功" + data)    //打印

                        window.location = "/index";
                    }

                },
                error: function () {
                    layer.msg("请求异常！", {icon: 0, time: 3000});
                }
            });

        })
    })

</script>


</body>
</html>